<%@ page import="java.sql.*,java.util.*,java.text.*,java.text.SimpleDateFormat" %>
<%@ page import="javax.servlet.*" %>
<%@page import="connection.DBConnection"%>

<%@ page import="javax.servlet.http.*" %>

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
<LINK REL=StyleSheet HREF="dimming.css" TYPE="text/css">
		<SCRIPT LANGUAGE="JavaScript" SRC="dimmingdiv.js">
		</SCRIPT>
<style>
div.dimmer 
{
	visibility: hidden;
	position:absolute;
	left:0px;
	top:0px;
	font-family:verdana;
	font-weight:bold;
	padding:40px;

	background-image:url(honey.png);
	/* ieWin only stuff */
	_background-image:none;
	_filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=scale src='honey.png');
}


div.dimming {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 11px;
	font-style: normal;
	background-color: #ffffff;
	position:absolute;
	/* set z-index higher than possible */
	z-index:10000;
	visibility: hidden;
	
	border-style: solid;
	border-color: #999999;
	border-width: 1px;

}

table.floatingHeader
{
	background-color: #0000ff;
	color:#ffffff;
}


</style>
		<script language="javascript">
		    function displayWindow()
		    {
		        var w, h, l, t;
		        w = 400;
		        h = 400;
		        l = screen.width/4;
		        t = screen.height/4;
                
                // no title		        
		        // displayFloatingDiv('windowcontent', '', w, h, l, t);

                // with title		        
		        displayFloatingDiv('windowcontent', 'General Ledgers', w, h, l, t);
		    }
		    
		    
		</script>
		<script language="javascript">
		    function displayWindow1()
		    {
		        var w, h, l, t;
		        w = 400;
		        h = 400;
		        l = screen.width/4;
		        t = screen.height/4;
                
                // no title		        
		        // displayFloatingDiv('windowcontent', '', w, h, l, t);

                // with title		        
		        displayFloatingDiv('window1', 'Masters', w, h, l, t);
		    }
		    
		    
		</script>
		
<%--		<script>
		function check()
		{
		if (!document.f1.voucher[0].checked   ){ 

			alert("Please Select At least one"); 
			return false;
			}
		}
		</script>
 --%>
</head>
<body>
<h2 align="center"> Quick Function</h2>

<form action="QuickServlet" name=f1 ONSUBMIT="return check();">
				<table border="1" align="center">
			<tr><td width=50 align="center">1</td>
			<td>Book A voucher</td>
			<td ><font color=red>Sales Voucher</font></td>
				<td><input type="checkbox" name="voucher"
					value="Sales Voucher" /></td>
				
			</tr>
			<tr><td></td><td></td>
			<td><font color=red>Purchase Voucher</font></td>
				<td><input type="checkbox" name="voucher"
					value="Purchase Voucher" /></td>
				
			</tr>
			<tr><td></td><td></td>
			<td><font color=red>Receipt</font></td>
				<td><input type="checkbox" name="voucher"
					value="Receipt" /></td>
				
			</tr>
			<tr><td></td><td></td>
			<td><font color=red>Payment</font> </td>
				<td><input type="checkbox" name="voucher"
					value="Payment" /></td>
				
			</tr>
			<tr>
			<td></td><td></td><td><font color=red> Contra</font> </td>
				<td><input type="checkbox" name="voucher"
					value="Contra" /></td>
				
			</tr>
			<tr><td></td><td></td>
			<td><font color=red> Journal</font> </td>
				<td><input type="checkbox" name="voucher"
					value="Journal"></td>
				
			</tr>
			<tr><td align="center">2</td>
			<td>Create Masters</td>
			<td><font color=red>Customer Master</font></td>
				<td><input type="checkbox" name="voucher"
					value="Customer Master" /></td>
			</tr>
			<tr><td></td><td></td>
			<td><font color=red> Supplier Master </font></td>
				<td><input type="checkbox" name="voucher"
					value="Supplier Master"></td>
				
			</tr>
	        <tr><td></td><td></td>
			<td><font color=red> Bank Master</font></td>
				<td><input type="checkbox" name="voucher"
					value="Bank Master"></td>
				
			</tr>
			<tr><td></td><td></td>
			<td><font color=red> General Ledger Master</font> </td>
			
				<td><input type="checkbox" name="voucher"
					value="General Ledger Master"></td>
				
			</tr>
			
            
			<tr><td align="center">3</td>
			<td>View General Ledger</td>
			<td><a href="javascript:displayWindow();">Select the Ledger</a></td>
				<td></td>
			</tr>
			
 
			<tr><td align="center">4</td>
			<td>View Financial Report</td>
			<td><font color=red>Balance Sheet</font></td>
				<td><input type="checkbox" name="voucher"
					value="Balance Sheet" /></td>
			</tr>
			<tr><td></td><td></td>
			<td> <font color=red>Profit and Loss Account </font></td>
				<td><input type="checkbox" name="voucher"
					value="Profit And Loss Account"></td>
				
			</tr>
			<tr><td></td><td></td>
			<td><font color=red> Cash Flow statement</font> </td>
				<td><input type="checkbox" name="voucher"
					value="cash"></td>
				
			</tr>
			<tr><td></td><td></td>
			<td><font color=red> Trial Balance </font></td>
				<td><input type="checkbox" name="voucher"
					value="Trial Balance"></td>
				
			</tr>
			<tr><td align="center">5</td>
			<td>View Masters Details</td>
			<td><a href="javascript:displayWindow1();">Select the Ledger</a></td><td></td></tr>
		
		
							</table><br>
			<center><input type="submit" name=first value="Add Quick Function" /></center><br>
			<center><input type="submit" name=second value="Delete Quick Function" /></center>
			</form>
			<br>
			<center><a href="HomePage.jsp">Back to Home Page</a></center>
			
			
			
			<div style="width: 518px; height: 287px;visibility:hidden" id="windowcontent">
            <script language="javascript">
            function check1()
    		{
    		if (document.f2.voucher1.checked==false   ){ 

    			alert("Please Select At least one"); 
    			return false;
    			}
    		}
            </script>
            <form action=GeneralQuickServlet name=f2 ONSUBMIT="return check1();">
            <table border=2>
            <tr>
		<td>General Ledgers</td>
	
    	</tr>
           <tr>
			<%
			 DBConnection dbc=new DBConnection();
			Connection con3=dbc.getNewConnection();
			
			Statement st = null;
			ResultSet rs = null;
            
            String inv="",newdate="",name2="",cd="";
			 double adj=0.0,amt1=0.0;
			 
            try
			{
			   st=con3.createStatement() ;
       		   rs=st.executeQuery("select gname,gcode from generalledger2");
	        	//rs=st.executeQuery("select date,");
	         while(rs.next()){ 
	        	 String dt=rs.getString(1);
	        	 cd=rs.getString(2);
	    	  %>
	    	
	         <td><font color=red><%=dt %></font></td>
	         <td><input type=checkbox name=voucher1 value="<%=cd%>"/></td>
	         <input type=hidden name=voucher2 value="<%=dt%>"/>
	         </tr>
	    	  
	    	 
	    	  <% 
	       }
	       
	         con3.close();
	         
			}
			catch(Exception e2){}
            %>
       
        </table>
        <input type=submit name=first value="Add Quick Function" />
         <input type=submit name=second value="Delete Quick Function" />
        </form>
        </div>
 
 
 <div style="width: 518px; height: 287px;visibility:hidden" id="window1">
            <script language="javascript">
            function Hello()
            {
               alert('Hello '+  document.getElementById('yourname').value + '!');
               
               
            }
            </script>
            <form action=MasterQuickServlet>
            <table border=2>
            <tr>
		<td>General Ledgers</td>
	
    	</tr>
           <tr>
		<%	
		
		 DBConnection dbc1=new DBConnection();
		Connection con1=dbc1.getNewConnection();
		String name1="";
		try
{
			
			Statement st1=null;
			ResultSet rs1=null;
	  st1=con1.createStatement() ;
	  rs1=st1.executeQuery("select name,code from ((select cname as name,ccode as code from customermaster) union all (select sname as name,scode as code from suppliermaster) union all (select bname as name, micr as code from bankmaster))p ;");
while(rs1.next()){
	name1=rs1.getString(1);
	name2=rs1.getString(2);
	
	%>

	    	
	         <td><font color=red><%=name1 %></font></td>
	         <td><input type=checkbox name=voucher2 value="<%=name2%>"/></td>
	         
	         </tr>
	    	  
	    	 
	    	  <% 
	       }
	       
	         con3.close();
	         
			}
			catch(Exception e1){}
            %>
       
        </table>
        <input type=submit name=first value="Add Quick Function" />
        <input type=submit name=second  value="Delete Quick Function" />
        </form>
</div>
 
 
 
			</body>
			</html>